﻿using System;

namespace Hvam.SharePoint.Search.Language.Parsers
{
    internal class ParserInput
    {
        public int Index { get; private set; }
        public string @String { get; private set; }

        public ParserInput(string @string)
        {
            @String = @string;
        }

        public ParserInput(ParserInput input)
        {
            Index = input.Index;
            @String = input.String;
        }

        public char Current()
        {
            return @String[Index];
        }

        public static ParserInput operator ++(ParserInput tokens)
        {
            tokens.Index++;

            return tokens;
        }

        public bool AtEnd()
        {
            return Index >= @String.Length;
        }
    }
}